 function getEndTime(myYear){
      var myEndTime = new Date(''+myYear+'/06/07 00:00:00'); /*函数，得到末尾高考值*/
      return myEndTime;
  }

  function countDown(){
      var mydate = new Date();/*创建date对象*/
      var year = '2023';
      var EndTime = getEndTime(year);
      var NowTime = new Date();
      if( (EndTime.getTime() - NowTime.getTime() ) < 0){
          year = mydate.getFullYear() + 1;
          EndTime = getEndTime(year);
      }   /*用语言翻译一下，就是如果endtime<nowtime,则year错误，year加一，并重新返回endtime*/
      var t = EndTime.getTime() - NowTime.getTime();/*得到endtime*/


      /*此处的t为毫秒单位，故要除1000*/
      var d=Math.floor(t/1000/60/60/24);
      var h=Math.floor(t/1000/60/60%24);
      var m=Math.floor(t/1000/60%60);
      var s=Math.floor(t/1000%60);
        /*得到元素，也是输出*/
      document.getElementById('day').innerText = d;
      document.getElementById('hour').innerText = h;
      document.getElementById('minute').innerText = m;
      document.getElementById('second').innerText = s;
      /*向对应的id得到元素输出*/
  } 
  setInterval(countDown,1000);/*意思为1000ms（即1s）处理一次countdown函数*/